{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "resident-directive",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import linear_model\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn.neighbors import KNeighborsRegressor\n",
    "from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor\n",
    "from sklearn.svm import SVR\n",
    "from sklearn.model_selection import train_test_split,cross_val_score\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import os\n",
    "import seaborn as sns\n",
    "from sklearn.datasets import load_boston\n",
    "import matplotlib.pyplot as plt\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "opposed-apparel",
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.rcParams['font.sans-serif']=['SimHei']\n",
    "plt.rcParams['axes.unicode_minus'] = False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "changed-guarantee",
   "metadata": {},
   "outputs": [],
   "source": [
    "#1 准备数据\n",
    "#定义当前目录\n",
    "os.chdir(r'./')\n",
    "work_path = os.getcwd()\n",
    "#第六章节提取的植被指数、纹理特征和波段数据用于本章的建模数据\n",
    "file_path = os.path.join(work_path,'使用数据','variable_GF2.csv')\n",
    "#初始化数据集\n",
    "data = pd.read_csv(file_path,engine = 'python')\n",
    "#查看数据\n",
    "data.head()\n",
    "\n",
    "#2 分割数据\n",
    "#定义训练数据和测试数据\n",
    "x = data.iloc[:,1:]\n",
    "y = data['AGB']\n",
    "#划分训练集与测试集，随机采样25%作为测试 75%作为训练\n",
    "x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.25, random_state=33)\n",
    "\n",
    "#3 在训练前标准化训练集与测试集\n",
    "ss_x = StandardScaler().fit(x_train)\n",
    "x_train = ss_x.transform(x_train)\n",
    "x_test = ss_x.transform(x_test)\n",
    "ss_y = StandardScaler().fit(y_train.values.reshape(-1, 1))\n",
    "y_train = ss_y.transform(y_train.values.reshape(-1, 1))\n",
    "y_test = ss_y.transform(y_test.values.reshape(-1, 1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "proper-motel",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "线性回归的默认评估值为： -1.6157448114315982\n",
      "线性回归的R_squared值为： -1.6157448114315982\n",
      "线性回归的均方误差为: 7370.259388542501\n",
      "线性回归的平均绝对误差为: 63.298072200668884\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x16924658978>]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAESCAYAAAD0aQL3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAolUlEQVR4nO3deXjU1dn/8fdNFghr2JdA2LcgIBIRERVURBSsW11qXWr9Wa1tH621dam0ILivT11aWrVata1Pa60sAoJYUUQFlyohYd+i7JBACFnv3x8zaAwJCUkmk5n5vK6Li5kz230S+N7zPed872PujoiIxJ5G4Q5ARETCQwlARCRGKQGIiMQoJQARkRilBCAiEqOUAEREYpQSgIhIjFICEBGJUfHhDqAhMbMzgeFAF3f/abjjEREJpQZ3BmBmc81sRpn775rZH6vxumfNLKU2n+3u8939XiChNu8jIhIJGuIZQDMgGcDMxgBNgIxqvK6bu2dX90PM7HTghjJNN7j7DjO7CXi+uu8jIhKpGlQCMLMWQC5QGmy6AVgEZJjZHcBZwAdAT3e/qMzrDEg2sz8BJwPXu/siM/uAQPIYDdwOXA70A0a5+0JgYbnP/zEwInh7qatQkohEsYY2BDQQyAT2mdmpwCogBTgI9HD3U4A1QKaZdTKzO4Ov6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AT4MYFx+z8HarHRDLgj+PR/A48DKcChGi7nEEgI17p7hpk1LfP2nYFrg7c7EUgYImGjBCBShrvPAmbB19U37wHeBrYBL7p7UXAIqCXwGvA0gYP6yQT2JZgL/NbM+rj7mnJvvzP4GgiUdBYJK10HIFKOmaUEV/28S2CFzhMEvuUvMbMLCSzfzCUwCQzwb3fPJ/CFqoTAJiYXHXo7oFGwwFdO8D3fJTikFGwXCQtdByBShpk1JjCskwn8rWx9GTPrCNxMYNnnze5+dfAir7jga/oAp5VdEWRmowlcI5BCoI7/tz4O+Iu7/y2EXRKplBKAiEiM0hCQiEiMUgIQEYlRSgAiIjFKCUBEJEYpAYiIxCglABGRGPX/Abc8+DvcsphsAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"\n",
    "线性回归\n",
    "\"\"\"\n",
    "#定义线性回归模型\n",
    "lr = linear_model.LinearRegression()\n",
    "lr.fit(x_train,y_train)\n",
    "\n",
    "#5 模型评估\n",
    "#计算模型评估参数\n",
    "'''线性回归的默认评估值'''\n",
    "acc = lr.score(x_test,y_test)\n",
    "'''线性回归的R_squared值'''\n",
    "y_predict = lr.predict(x_test)\n",
    "r2 = r2_score(y_test, y_predict)\n",
    "'''线性回归的均方误差'''\n",
    "mean_squared_error_value = mean_squared_error(\n",
    "ss_y.inverse_transform(y_test),\n",
    "ss_y.inverse_transform(y_predict))\n",
    "'''线性回归的平均绝对误差'''\n",
    "mean_absolute_error_value = mean_absolute_error(\n",
    "ss_y.inverse_transform(y_test),\n",
    "ss_y.inverse_transform(y_predict))\n",
    "print(\"线性回归的默认评估值为：\",acc)\n",
    "print(\"线性回归的R_squared值为：\",r2)\n",
    "print(\"线性回归的均方误差为:\", mean_squared_error_value)\n",
    "print(\"线性回归的平均绝对误差为:\",mean_absolute_error_value)\n",
    "\n",
    "#显示结果\n",
    "y = ss_y.inverse_transform(y_test)\n",
    "pre_y = lr.predict(x_test)\n",
    "pre_y = ss_y.inverse_transform(pre_y)\n",
    "data = pd.DataFrame(np.column_stack([y,pre_y]),columns=['original','predict'])\n",
    "\n",
    "original= data['original']\n",
    "predict = data['predict']\n",
    "plt.scatter(original, predict)\n",
    "plt.xlabel('实际值')\n",
    "plt.ylabel('预测值')\n",
    "plt.text(x = -40 ,y = 540 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "plt.plot([500,0],[500,0])\n",
    "# plt.savefig(r'g:\\python林业资源\\出图/回归线性.png',dpi=300)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "departmental-christian",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "平均k近邻回归的默认评估值为： 0.16740205847801137\n",
      "平均k近邻回归的R_squared值为： 0.16740205847801137\n",
      "平均k近邻回归的均方误差为: 2345.9715063049703\n",
      "平均k近邻回归 的平均绝对误差为: 36.93275686477273\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x16924658a58>]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEUCAYAAAAiMOHqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAqBklEQVR4nO3deXxU1f3/8deHQFjCLvsS9p2AYkBAREQp4lYRqm1d2lqLtXaz3yqgYlFRcanVX+tSrLVqtZYSFgUFRVRQ3FgkCSHsawDZSYCELHN+f9yJxmTCEmYymZn38/Hw4eTMZObchNz3veee+znmnENERGJPtXB3QEREwkMBICISoxQAIiIxSgEgIhKjFAAiIjFKASAiEqMUACIiMUoBICISo6qHuwNViZl9DzgXaOWc+024+yMiEkp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 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"\n",
    "KNN回归\n",
    "\"\"\"\n",
    "\n",
    "#定义KNN回归模型\n",
    "uni_knr = KNeighborsRegressor(n_neighbors=2)\n",
    "uni_knr.fit(x_train, y_train.ravel())\n",
    "#预测\n",
    "uni_knr_predict = uni_knr.predict(x_test)\n",
    "# 5 模型评估\n",
    "# 平均k近邻回归 模型评估\n",
    "print(\"平均k近邻回归的默认评估值为：\", uni_knr.score(x_test, y_test))\n",
    "print(\"平均k近邻回归的R_squared值为：\", r2_score(y_test, uni_knr_predict))\n",
    "print(\"平均k近邻回归的均方误差为:\", mean_squared_error(ss_y.inverse_transform(y_test),\n",
    "                                              ss_y.inverse_transform(uni_knr_predict)))\n",
    "print(\"平均k近邻回归 的平均绝对误差为:\", mean_absolute_error(ss_y.inverse_transform(y_test),\n",
    "                                                 ss_y.inverse_transform(uni_knr_predict)))\n",
    "#显示结果\n",
    "y = ss_y.inverse_transform(y_test)\n",
    "pre_y = uni_knr.predict(x_test)\n",
    "pre_y = ss_y.inverse_transform(pre_y)\n",
    "data = pd.DataFrame(np.column_stack([y,pre_y]),columns=['original','predict'])\n",
    "original= data['original']\n",
    "predict = data['predict']\n",
    "plt.scatter(original, predict)\n",
    "plt.xlabel('实际值')\n",
    "plt.ylabel('预测值')\n",
    "plt.text(x = -40 ,y = 540 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "plt.plot([500,0],[500,0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "wooden-location",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "回归树的默认评估值为： -0.4181586483806594\n",
      "平回归树的R_squared值为： -0.4181586483806594\n",
      "回归树的均方误差为: 3995.877979759734\n",
      "回归树的平均绝对误差为: 45.73905512318182\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1692502fac8>]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEUCAYAAAAiMOHqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAp30lEQVR4nO3dd3iUdbrG8e9DIBA6SOi9d0QCAiIiyiJ2RLdZ13VxXbe5uwjYC4tYz7rWxeO6dg9LKCooFnQBsQC6JCGEIj30lgTSM7/zx0w0JpMEyEwmM3N/risXM79pzzsh7/3W5zXnHCIiEn1qhboAEREJDQWAiEiUUgCIiEQpBYCISJRSAIiIRCkFgIhIlFIAiIhEKQWAiEiUqh3qAmoSM/sRMARo65z7XajrEREJphq3BmBm75vZ7BL3V5jZCyfwun+aWbuqfLZz7gPn3ENAnaq8j4hIOKiJawANgKYAZjYGqAeknsDrOjjn0k/0Q8zsPOCWEkO3OOcOmNkfgZdP9H1ERMJVjQoAM2sEZAIe39AtwCdAqpndAVwAfAl0cc5dWeJ1BjQ1s/8FzgZ+7Zz7xMy+xBseo4DpwNVAT2Ckc+5j4ONSn/8bYJjv9hdOjZJEJILVtE1AfYA0IMvMzgE2Au2AXKCzc240sBlIM7PWZnan73WdAANuBX4NjDGzjng35dwM/BW4wjk3EXgP6Ovvw51zzzrnfu6c+5tm/iIS6WrUGgDeGXMq0Bx4HO8S/3xgHFC8X6AAWOec24t3xg7QH3jdOZdnZi2Arb6xN5xz+WbWHHjF99xmwI7qmBgRkZqspq0B9AXWA8uAl4DDeDcHNQU8ZlYbuJ6y+wT6AWt9twcB6/AGQPHYwBK3253MvgIRkUhV0wKgD5DqnPvSOfcM0AXv0vyreJfgXwbq491MVFI/IKXE7VS8AZDkG2vtnNvj21fgQUREsHDY1G1mtZ1zhWbWA/irc+7Hoa5JRCTc1bR9AOWZZWZD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6Yk4J3Bv+/ZpbrG9vqnPOYWQPgWt9rL8LbxkIkZBQAImU1wLuN/g3gHbwnYG3087w5eJtzjcO7medD4HLA45zLNrO+wB/xNi0D7+ak7r7bLYNTusiJUwCIlOBb4p8C5AC/BX6Dd7v9v7y92GgA3OF7+kLgSaAdUNzD5SK8gXCTcy7VzOqXePs2wE2+263xBoZIyCgAREpwzr0LvAvfdd+cCXwK7ANec84V+DYBNQYWAM/hnamfjfe6BO8D95lZd+fc5lJvf9D3GvC2dBYJKZ0HIFKKmbXzHfWzAu8ROk/jXcpfaWaT8B6+mYl3JzDAQudcDt4FqiK8FzG5svjtgFq+Bl8ZvvdcgW+Tkm9cJCR0HoBICWZWF+9mnTTgrZL9ZcysFXAb3sM+b3PO3eA7ySvG95ruwNiSRwSZ2Si85wi0w9vH/wcfB7zqnHsriJMkUi4FgIhIlNImIBGRKKUAEBGJUgoAEZEopQAQEYlSCgARkSilABARiVL/D59CY95JoXwXAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"\n",
    "决策树回归\n",
    "\"\"\"\n",
    "\n",
    "#定义决策树回归模型\n",
    "dtr = DecisionTreeRegressor()\n",
    "#训练\n",
    "dtr.fit(x_train, y_train)\n",
    "# 预测 保存预测结果\n",
    "dtr_y_predict = dtr.predict(x_test)\n",
    "#5 模型评估\n",
    "print(\"回归树的默认评估值为：\", dtr.score(x_test, y_test))\n",
    "print(\"平回归树的R_squared值为：\", r2_score(y_test, dtr_y_predict))\n",
    "print(\"回归树的均方误差为:\", mean_squared_error(ss_y.inverse_transform(y_test),\n",
    "                                           ss_y.inverse_transform(dtr_y_predict)))\n",
    "print(\"回归树的平均绝对误差为:\", mean_absolute_error(ss_y.inverse_transform(y_test),\n",
    "                                                ss_y.inverse_transform(dtr_y_predict)))\n",
    "\n",
    "#显示预测结果\n",
    "y = ss_y.inverse_transform(y_test)\n",
    "pre_y = dtr.predict(x_test)\n",
    "pre_y = ss_y.inverse_transform(pre_y)\n",
    "data = pd.DataFrame(np.column_stack([y,pre_y]),columns=['original','predict'])\n",
    "original= data['original']\n",
    "predict = data['predict']\n",
    "plt.scatter(original, predict)\n",
    "plt.xlabel('实际值')\n",
    "plt.ylabel('预测值')\n",
    "plt.text(x = -40 ,y = 540 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "plt.plot([500,0],[500,0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "other-guard",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "支持向量机的默认评估值为： -0.1814164670235141\n",
      "支持向量机的R_squared值为： -0.1814164670235141\n",
      "支持向量机的均方误差为: 3328.8208275536\n",
      "支持向量机的平均绝对误差为: 46.60596635770607\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Admin\\AppData\\Roaming\\Python\\Python36\\site-packages\\sklearn\\utils\\validation.py:63: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n",
      "  return f(*args, **kwargs)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1692502fba8>]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEUCAYAAAAiMOHqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAql0lEQVR4nO3dd3hVVdbH8e8iEAih9947JIgEBERElAFUVIrTrOM4qOM0Z14EVBQbYhlH3xl1BsdxrOOLhKKAoogKFlRQSUKo0kMLLQFSSNnvH/cyxpCQkNyb236f5+HxZt9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CEAkYJQCRIpxzi4BF8N/qmzOBj4D9wKvOuTxvF1A9YAHwHJ6D+gV41iV4F5hhZl2cc1uKffxB73vAU9JZJKB0H4BIMWbW2jvr5xM8M3T+hucs/zMzm4Bn+mYmnkFggIXOuWw8J1QFeBYxmXjq44Bq3gJfGd7P/ARvl5K3XSQgdB+ASBFmVhNPt84G4I2i9WXMrDlwB55pn3c452703uQV5X1PF2BE0RlBZjYUzz0CrfHU8f/B5oBXnHNv+HGXREqlBCAiEqHUBSQiEqGUAEREIpQSgIhIhFICEBGJUEoAIiIRSglARCRC/T/3rcxqflFXegAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"\n",
    "svm回归\n",
    "\"\"\"\n",
    "#定义向量机回归模型\n",
    "linear_svr=SVR(kernel='linear')\n",
    "linear_svr.fit(x_train,y_train)\n",
    "#5 模型评估\n",
    "#计算模型评估参数\n",
    "'''支持向量机的默认评估值'''\n",
    "acc = linear_svr.score(x_test,y_test)\n",
    "'''支持向量机的R_squared值'''\n",
    "y_predict = linear_svr.predict(x_test)\n",
    "r2 = r2_score(y_test, y_predict)\n",
    "'''支持向量机的均方误差'''\n",
    "mean_squared_error_value = mean_squared_error(\n",
    "ss_y.inverse_transform(y_test),\n",
    "ss_y.inverse_transform(y_predict))\n",
    "'''支持向量机的平均绝对误差'''\n",
    "mean_absolute_error_value = mean_absolute_error(\n",
    "ss_y.inverse_transform(y_test),\n",
    "ss_y.inverse_transform(y_predict))\n",
    "print(\"支持向量机的默认评估值为：\",acc)\n",
    "print(\"支持向量机的R_squared值为：\",r2)\n",
    "print(\"支持向量机的均方误差为:\", mean_squared_error_value)\n",
    "print(\"支持向量机的平均绝对误差为:\",mean_absolute_error_value)\n",
    "\n",
    "#显示结果\n",
    "y = ss_y.inverse_transform(y_test)\n",
    "pre_y = linear_svr.predict(x_test)\n",
    "pre_y = ss_y.inverse_transform(pre_y)\n",
    "data = pd.DataFrame(np.column_stack([y,pre_y]),columns=['original','predict'])\n",
    "data.to_csv('predict.csv')\n",
    "\n",
    "original= data['original']\n",
    "predict = data['predict']\n",
    "plt.scatter(original, predict)\n",
    "plt.xlabel('实际值')\n",
    "plt.ylabel('预测值')\n",
    "plt.text(x = -40 ,y = 540 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "plt.plot([500,0],[500,0])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "laughing-brick",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Admin\\AppData\\Roaming\\Python\\Python36\\site-packages\\ipykernel_launcher.py:5: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples,), for example using ravel().\n",
      "  \"\"\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "随机森林回归的默认评估值为： 0.3233735571717624\n",
      "随机森林回归的R_squared值为： 0.3233735571717624\n",
      "随机森林回归的均方误差为: 1906.4980540137606\n",
      "随机森林回归的平均绝对误差为: 34.2843916687177\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1692125bf98>]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEUCAYAAAAiMOHqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAqFUlEQVR4nO3deXhU9dnG8e9DCBB2kB1kk0WWgGhAQVREUXFHtLa1amstau1mW1lcUaniUquvdSnWWrVai4RFRcUFFdwFlSSEfZWwr2FJIMk87x8z0RgSwjKTmczcn+vicvKbycxzEnPuc87vnOeYu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KCn1PJ2BwyTOCzGwgwWsEWhPs4/+DjwNecPeXI7hIIuVSAIiIJCgdAhIRSVAKABGRBKUAEBFJUAoAEZEEpQAQEUlQCgARkQT1/3Bz6toWqbliAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"\n",
    "随机森林回归\n",
    "\"\"\"\n",
    "rfr = RandomForestRegressor(n_estimators=3000)\n",
    "rfr.fit(x_train,y_train)\n",
    "importances=rfr.feature_importances_\n",
    "\n",
    "#5 模型评估\n",
    "#计算模型评估参数\n",
    "'''随机森林回归的默认评估值'''\n",
    "acc = rfr.score(x_test,y_test)\n",
    "'''随机森林回归的R_squared值'''\n",
    "y_predict = rfr.predict(x_test)\n",
    "r2 = r2_score(y_test, y_predict)\n",
    "'''随机森林回归的均方误差'''\n",
    "mean_squared_error_value = mean_squared_error(\n",
    "ss_y.inverse_transform(y_test),\n",
    "ss_y.inverse_transform(y_predict))\n",
    "'''随机森林回归的平均绝对误差'''\n",
    "mean_absolute_error_value = mean_absolute_error(\n",
    "ss_y.inverse_transform(y_test),\n",
    "ss_y.inverse_transform(y_predict))\n",
    "print(\"随机森林回归的默认评估值为：\",acc)\n",
    "print(\"随机森林回归的R_squared值为：\",r2)\n",
    "print(\"随机森林回归的均方误差为:\", mean_squared_error_value)\n",
    "print(\"随机森林回归的平均绝对误差为:\",mean_absolute_error_value)\n",
    "\n",
    "#显示结果\n",
    "y = ss_y.inverse_transform(y_test)\n",
    "pre_y = rfr.predict(x_test)\n",
    "pre_y = ss_y.inverse_transform(pre_y)\n",
    "data = pd.DataFrame(np.column_stack([y,pre_y]),columns=['original','predict'])\n",
    "\n",
    "original= data['original']\n",
    "predict = data['predict']\n",
    "plt.scatter(original, predict)\n",
    "plt.xlabel('实际值')\n",
    "plt.ylabel('预测值')\n",
    "plt.text(x = -40 ,y = 540 , s = r'$Mg·hm^{-2}$',size=8)\n",
    "plt.plot([500,0],[500,0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "minimal-selling",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
